<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Cache;

use Illuminate\Support\Facades\DB;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
    }

    /**
     * 启动应用服务
     *
     * @return void
     */
    public function boot()
    {

        if (env('APP_ENV') == 'local') {
            DB::listen(function ($query) {
                app('log')->info('sql监听-----' . $query->sql);
                app('log')->info('sql bindings-----', $query->bindings);
                $query->bindings;
                $query->time;
            });
        }
    }
}
